#include "SandboxApp.h"
#include <imgui/imgui.h>

#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>

#include "Core/entryPoint.h"

#include "Project00.h"
#include "Project01.h"
#include "Project02.h"
#include "Project03.h"
#include "Project04.h"
#include "Project05.h"
#include "Project06.h"
#include "Project07.h"
#include "Project08.h"
#include "Project09.h"
#include "Project10.h"
#include "Project11.h"
#include "Project12.h"
#include "Project13.h"
#include "Project14.h"
#include "Project15.h"
#include "Project16.h"
#include "Project17.h"
#include "Project18.h"

bool isDesktop = false;

#define NUMBER (0)

static std::string title = "Project" + CC::Tool::Int2StrZero(NUMBER, 2);

SandboxApp::SandboxApp(const CC::ApplicationSpecification& specification)
    :CC::Application(specification)
{

    //GetWindow().SetIsDesktopFlag(true); //for keyborad listen

    appScene = new CC::Scene();
    appScene->LoadFont(PATHCONFIG("assets/fonts/Alimama_DongFangDaKai_Regular.ttf"), "Alimama_DongFangDaKai_Regular");

#if NUMBER == 1    
    PushLayer(new Project01(title, appScene));
#elif NUMBER == 2    
    PushLayer(new Project02(title, appScene));
#elif NUMBER == 3 
    PushLayer(new Project03(title, appScene));
#elif NUMBER == 4
    PushLayer(new Project04(title, appScene));
#elif NUMBER == 5
    PushLayer(new Project05(title, appScene));
#elif NUMBER == 6
    PushLayer(new Project06(title, appScene));
#elif NUMBER == 7
    PushLayer(new Project07(title, appScene));
#elif NUMBER == 8
    PushLayer(new Project08(title, appScene));
#elif NUMBER == 9
    PushLayer(new Project09(title, appScene));
#elif NUMBER == 10
    PushLayer(new Project10(title, appScene));
#elif NUMBER == 11
    PushLayer(new Project11(title, appScene));
#elif NUMBER == 12
    PushLayer(new Project12(title, appScene));
#elif NUMBER == 13
    PushLayer(new Project13(title, appScene));
#elif NUMBER == 14
    PushLayer(new Project14(title, appScene));
#elif NUMBER == 15
    PushLayer(new Project15(title, appScene));
#elif NUMBER == 16
    PushLayer(new Project16(title, appScene));
#elif NUMBER == 17
    PushLayer(new Project17(title, appScene));
#elif NUMBER == 18
    PushLayer(new Project18(title, appScene));
#else
    PushLayer(new Project00(title, appScene));
#endif // DEBUG    

    CC_INFO("  XX-Vendor: {%s}\n", glGetString(GL_VENDOR));
    CC_INFO("  XX-Renderer: {%s}\n", glGetString(GL_RENDERER));
    CC_INFO("  XX-Version: {%s}\n", glGetString(GL_VERSION)); 
}

SandboxApp::~SandboxApp()
{
    if(appScene) delete appScene;
}

CC::Application* CC::CreateApplication(CC::ApplicationCommandLineArgs args){
    CC::ApplicationSpecification _ApplicationSpecification = { title, "", args, 800, 600, true};
	return new SandboxApp(_ApplicationSpecification);
}